<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.czxy.domain.User" %>
<%@ page import="java.util.Arrays" %>
<%@ page language="java" pageEncoding="UTF-8"%>
<HTML>
<HEAD>
	<meta http-equiv="Content-Language" content="zh-cn">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<LINK href="${pageContext.request.contextPath}/css/Style.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form name="Form1" method="post"  action="${pageContext.request.contextPath}/userServlet" >

	<input type="hidden" name="method" value="add">
	&nbsp;
	<table cellSpacing="1" cellPadding="5" width="100%" align="center" bgColor="#eeeeee" style="border: 1px solid #8ba7e3" border="0">
		<tr>
			<td class="ta_01" align="center" bgColor="#afd1f3" colSpan="4"
				height="26">
				<strong><STRONG>添加用户</STRONG>
				</strong>
			</td>
		</tr>

		<tr>
			<td width="18%" align="center" bgColor="#f5fafe" class="ta_01">
				登录名：
			</td>
			<td class="ta_01" bgColor="#ffffff" colspan="3">
				<input type="input" name="loginName" id="logonName" value="${user.loginName}" class="bg"/>
			</td>
		</tr>
		<tr>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				密码：
			</td>
			<td class="ta_01" bgColor="#ffffff">
				<input type="password" name="loginPwd"  value="${user.loginPwd}" id="logonPwd"/>
			</td>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				用户姓名：
			</td>
			<td class="ta_01" bgColor="#ffffff">
				<input type="text" name="userName" value="${user.userName}" class="bg" />
			</td>
		</tr>
		<tr>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				性别：
			</td>
			<td class="ta_01" bgColor="#ffffff">
				<input type="radio" value="男" name="sex" ${user.sex eq '男' ? 'checked':''} id="sex0"/>男
				<input type="radio" value="女" name="sex" ${user.sex eq '女' ? 'checked':''} id="sex1"/>女
			</td>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				学历：
			</td>
			<td class="ta_01" bgColor="#ffffff">
				<select name="education" id="education">
					<option value="">--选择学历--</option>
					<option value="博士" ${user.education eq '博士' ? 'selected':''}  >博士</option>
					<option value="硕士" ${user.education eq '硕士' ? 'selected':''} >硕士</option>
					<option value="本科" ${user.education eq '本科' ? 'selected':''} >本科</option>
					<option value="专科" ${user.education eq '专科' ? 'selected':''} >专科</option>
					<option value="高中" ${user.education eq '高中' ? 'selected':''} >高中</option>
				</select>
			</td>
		</tr>
		<tr>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				出生日期：
			</td>
			<td class="ta_01" bgColor="#ffffff">
				<input type="text" name="birthday" id="birthday" value="${user.birthday}" size="20"   />
			</td>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				电话：
			</td>
			<td class="ta_01" bgColor="#ffffff">
				<input type="text" name="telephone" value="${user.telephone}" id="telephone"/>
			</td>
		</tr>
		<tr>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				兴趣爱好：
			</td>
			<%--					<%--%>
			<%--						User user = (User) request.getAttribute("user");--%>
			<%--						String s= "";--%>
			<%--						if(user !=null){--%>
			<%--							s = Arrays.toString(user.getInterest());--%>
			<%--						}--%>
			<%--						pageContext.setAttribute("s", s);--%>

			<%--					%>--%>
			<td class="ta_01" bgColor="#ffffff" colSpan="3">
				<%--						 看电影<input type="checkbox" name="interest" ${s.contains("看电影") ? 'checked':''} value="看电影" />--%>
				<%--						 旅游<input type="checkbox" name="interest" ${s.contains("旅游") ? 'checked':''} value="旅游" />--%>
				<%--						健身 <input type="checkbox" name="interest" ${s.contains("健身") ? 'checked':''} value="健身" />--%>
				<%--						 购物<input type="checkbox" name="interest" ${s.contains("购物") ? 'checked':''} value="购物" />--%>
				<%--						 睡觉<input type="checkbox" name="interest" ${s.contains("睡觉") ? 'checked':''} value="睡觉" />--%>
				<c:if test="${not empty user.interest}">
					看电影<input type="checkbox" name="interest" ${Arrays.toString(user.interest).contains("看电影") ? 'checked':''} value="看电影" />
					旅游<input type="checkbox" name="interest" ${Arrays.toString(user.interest).contains("旅游") ? 'checked':''} value="旅游" />
					健身 <input type="checkbox" name="interest" ${Arrays.toString(user.interest).contains("健身") ? 'checked':''} value="健身" />
					购物<input type="checkbox" name="interest" ${Arrays.toString(user.interest).contains("购物") ? 'checked':''} value="购物" />
					睡觉<input type="checkbox" name="interest" ${Arrays.toString(user.interest).contains("睡觉") ? 'checked':''} value="睡觉" />
				</c:if>
				<c:if test="${ empty user.interest}">
					看电影<input type="checkbox" name="interest" value="看电影" />
					旅游<input type="checkbox" name="interest" value="旅游" />
					健身 <input type="checkbox" name="interest"  value="健身" />
					购物<input type="checkbox" name="interest" value="购物" />
					睡觉<input type="checkbox" name="interest" value="睡觉" />
				</c:if>



			</td>
		</tr>
		<tr>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				简历资料：
			</td>
			<td class="ta_01" bgColor="#ffffff" colSpan="3">
				<input type="file" name="upload" size="30" readonly />
			</td>
		</tr>
		<TR>
			<TD class="ta_01" align="center" bgColor="#f5fafe">
				备注：
			</TD>
			<TD class="ta_01" bgColor="#ffffff" colSpan="3">
				<textarea cols="30" rows="3" name="remark" style="WIDTH: 96%">${user.remark}</textarea>
			</TD>
		</TR>
		<TR>
			<td align="center" colSpan="4" class="sep1">
				<img src="${pageContext.request.contextPath}/images/shim.gif">
			</td>
		</TR>


		<tr>
			<td class="ta_01" style="WIDTH: 100%" align="center"
				bgColor="#f5fafe" colSpan="4">

				<input type="submit"  value="确定" class="button_ok"/>
				<FONT face="宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT>
				<input type="reset"  value="重置" class="button_cancel"/>
				<FONT face="宋体">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT>
				<INPUT class="button_ok" type="button" onclick="history.go(-1)" value="返回"/>
				<span id="Label1"></span>
			</td>
		</tr>
	</table>
</form>

<h1>${addMsg}</h1>
</body>
</HTML>